<template>
  <div>
    <div @click="xxx"></div>
    <slider :announcement="announcement" :slides="slides"></slider>
    <booklist :books="lastupdatebooks"
              heading="最近更新"
              @haha="xxx"></booklist>

    <booklist :books="recommended"
              heading="编辑推荐"
              @haha="xxx"></booklist>

  </div>
</template>


<script type="text/ecmascript-6">
  import slider from './slider.vue'
  import booklist from "./list.vue"

  export default{
    components: {slider, booklist}//{slider, booklist}
    ,created(){
      this.$http.get("/src/data.json").then(res=> {
                this.announcement = res.body.announcement;
                this.slides = res.body.slides
                this.lastupdatebooks = res.body.lastupdatebooks
                this.recommended = res.body.recommended
              }
      )
    }

    ,data(){
      return {
        lastupdatebooks:[],
        recommended:[]
        , announcement:'',
        slides: []
      }
    }
    ,methods:{
      xxx(){
        window.alert('hahahhaha');
      }
    }
  }
</script>
